﻿using System;
using System.Diagnostics.Contracts;
using System.Diagnostics.CodeAnalysis;

namespace TrackIT.Common.Providers
{
    [ContractClass(typeof(DateTimeProviderContract))]
    public interface IDateTimeProvider
    {
        DateTime Now { get; }

        int GetWeekNumberOfMonth(DateTime date);
    }

    [ExcludeFromCodeCoverage]
    [ContractClassFor(typeof(IDateTimeProvider))]
    abstract class DateTimeProviderContract : IDateTimeProvider
    {
        public DateTime Now
        {
            get { return default(DateTime); }
        }

        public int GetWeekNumberOfMonth(DateTime date)
        {
            Contract.Requires(date != null);

            return default(int);
        }
    }
}